import { typeListAPI } from '@/api/typeListAPI.js'

const state = {
  typeList: []
}

const mutations = {
  gettypeList(state, res) {
    state.typeList = res
  }
}

const actions = {
  async gettypeList({ commit }) {
    const demo = await typeListAPI()
    if (demo.code == 200) {
      commit('gettypeList', demo.data)
    }
  }
}

const getters = {}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
